﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="MuaHang.aspx.cs" Inherits="MasterPageGroupF3.MuaHang" %>
    <%@ Import Namespace="DTO" %>
    <%@ Import Namespace="BUS" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
<script type="text/javascript">
    function replace() {
        document.getElementById('foo').innerHTML = "Hello, <b>AJAX</b> world!";
        alert("gh");
    }
</script>




<%
    int idProduct = int.Parse(Request.QueryString["idProduct"].ToString());
    PRODUCT pro = PRODUCTBUS.LaySanPhamCoID(idProduct);
    string slogan = pro.SLOGAN;
    int dongia = (int)pro.PRICE;
    if (slogan.Length > 30)
        slogan = slogan.Substring(0,30) + "...";

    string content = pro.CONTENT;
    
    if (content.Length > 100)
        slogan = slogan.Substring(0, 100) + "...";
    
     %>
    <div style="border-style:solid; border-width:1px; border-color:Aqua; height:500px">
        <div>
            <img src="../images/donhangCuaBan.PNG" width="706px" alt="left"/>
        </div>
        <div>
            <table style="width: 100%;color:Black" border="1px">
                <tr style="background-color:#02BAD6; ">
                    <td class="div_imgListCW"  align="center" style="width:10%">
                        STT
                    </td>
                    <td style="width: 50%"  align="center" >
                        Sản Phẩm/ Dịch Vụ
                    </td>
                    <td align="center" style="width:10%">
                        Số lượng
                    </td>
                    <td style="width:15%"  align="center">
                        Đơn Giá
                    </td>
                    <td  align="center" style="width:15%">
                        Thành Tiền
                    </td>
                </tr>
                <tr style="background-color:white">
                    <td class="div_imgListCW" align="center">
                        1
                    </td>
                    <td style="width: 362px" align="center">
                        <%
                            
                            Response.Write(slogan); 
                            %>
                    </td>
                    <td align="center">
                        &nbsp;<asp:DropDownList ID="DropDownList1" runat="server" 
                            onselectedindexchanged="DropDownList1_SelectedIndexChanged" 
                            AutoPostBack="True" DataMember="1" DataTextField="1" DataValueField="1">
                                                                                  
                        </asp:DropDownList>
                    </td>
                    <td style="width: 81px" align="center">
                        <div id="dongia">
                            <%Response.Write(dongia); %>
                            <asp:TextBox ID="TextBox2" runat="server" Enabled="False"></asp:TextBox>
                        </div>
                    </td>
                    <td align="center">
                    <div id="thanhtien">
                        <%Response.Write(dongia); %>
                        <asp:TextBox ID="TextBox1" runat="server" Enabled="False"></asp:TextBox>
                    </div>
                        
                    </td>
                </tr>
            </table>
        </div>

        <div style="margin-top:20px; float:left;">
        <%string image1 = "images/product/" + idProduct.ToString() + "/1.jpg";
              %>
              
            <img src="<%Response.Write(image1);%>" width="300px" height="300px"/>
          
        </div>
        <div style="color:Black;padding:40px 50px 0px 350px; font-size:20px; color:Blue">
            <%
                
                Response.Write(content);
                 %>
        </div>
        <div style="padding:30px 0px 0px 450px;">
            <asp:ImageButton ID="ImageButton2" runat="server" Height="33px" 
                ImageUrl="~/images/mua.png" onclick="ImageButton2_Click" Width="103px" />
        </div>
    </div>
</asp:Content>
